package holdtime.xlxc.tools.util;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;

/**
 * Created by 徐杨 on 16/8/6.
 * 邮箱：544066591@qq.com
 */
public class DateAndTimeUtil {
    public static String convertSecondToTime(int second) {
        int hours = second / 3600;
        int minutes = (second % 3600) / 60;
        int seconds = second % 60;
        return String.format(Locale.CHINA, "%02d:%02d:%02d", hours, minutes, seconds);
    }

    public static String currentDateAndTime() {
        SimpleDateFormat sDateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss", Locale.CHINA);
        return sDateFormat.format(new Date());
    }
}
